/**
 * 出货单打印
 * @author mengyb
 * @date 2019-05-13
 */
define(['lodop'],function () {

    var self,
        app = win.app,
        doc = document,
        layui=win.layui,
        table,
        vueData = {
            gwec:null,
            gwec_list:null
        }


    ;

    var Gwei005Print = app.Module.extend({
        init: function () {
            self = this;
            self._super({
                _tag: 'gwei005_print',
            }, win);
        },





        print:function(gwecdocno){
          app.ajax({
              xurl:'crm/gwei005/print',
              xdata:{
                  GWECDOCNO:gwecdocno
              },
              type:'POST',
              dataType:'json',
              cb:function (result) {
                  vueData.gwec=result.data.gwec;
                  vueData.gwec_list=result.data.gwec_list;

              }
          })
        },




        _call: function () {

        },

        _ready: function () {
            var vue = new Vue({
                el: '#gwei005_print',
                data: vueData,
                methods: {
                },
                created: function () {
                    self._setEleIsReady('gwei005_print');
                },
                updated: function(){
                    var content=doc.getElementById('content').innerHTML;
                    var LODOP = getLodop();
                    LODOP.PRINT_INIT('打印');
                    LODOP.ADD_PRINT_HTM(30, 20, "95%", "98%", content);
                    // LODOP.ADD_PRINT_BARCODE(5, 20, 260, 47, "128Auto", '45686432'); //一维码
                    //LODOP.ADD_PRINT_BARCODE(10, 80, 100, 115, "QRCode", rows[0]);
                    //LODOP.SET_PRINT_PAGESIZE(1,800,600,"");
                    //LODOP.ADD_PRINT_IMAGE('28%', '65%', 200, 200, "<img  border=\"0\" transcolor=\"#FFFFFF\" style='z-index: -1; position: absolute;' src='/' + '../../../static/images/gongzhang.png'/>");
                    LODOP.SET_PRINT_STYLEA(0, "HOrient", 3);
                    LODOP.SET_PRINT_STYLEA(0, "VOrient", 3);
                    LODOP.PREVIEW();
                }
            });
        },
        _lazy: function () {
            this._super();
        }
    });

    return new Gwei005Print();

});
